<?php

namespace app\controller;

use app\Code;
use think\Response;

class BaseController
{
    public function returnJson($data = [], $code= Code::SUCCESS, $msg = 'SUCCESS'): \think\Response
    {
        $result = [
            'msg' => $msg,
            'code' => $code,
            'data' => $data,
        ];
        return Response::create($result, 'json');
    }

}